// import style from "./comp.module.scss";
import { useDispatch, useSelector } from "react-redux"
import { Button } from "antd"
const View = () => {
  const { num } = useSelector((state: RootState) => ({
    num: state.handleNum.num
  }))
  // 修改仓库数据-字符
  const dispatch = useDispatch()
  const changeNum = () => {
    dispatch({ type: "change1"})
    // dispatch({ type: "change1", value: 5 })
  }
  // const changeAny = () => {
  //   dispatch({ type: "change2", value: "987654" })
  // }

  // 修改仓库数据-数组
  const { sarr } = useSelector((state: RootState) => {
    return state.handleArr.sarr;
  })

  return (
    <div className="page2">
      {/* <h1>page2</h1> */}
      <h1>{num}</h1>
      <Button onClick={changeNum}>修改数字</Button>
      {/* <h1>{any}</h1>
      <Button onClick={changeAny}>修改任意传值内容</Button> */}
      <h1>{sarr}</h1>
    </div>
  );
};
export default View;
